namespace ghost
{
    export class TargetData extends AtkData implements IPoolObject{                
        /**扣除蓝量*/public reduceMP:number;
        /**扣除怒气*/public reduceSP:number;                
        /**飘字的伤害*/public hurt:number;      
        /**真正的伤害*/public realHurt:number;      
        /**真伤*/public dmgRealHurt:number;
        /**治疗*/public heal:number;
        /**吸血*/public suck:number;                
        /**技能id*/public skillID:number;  
        /**技能配置*/public skillCfg:SkillCfg;
        /**无视护盾防御(真伤)*/public ignoreShield:boolean;
        /**穿透率(用于计算多少伤害无视护盾)*/public penetratePer:number;
        /**击中类型，参考参考Constants.FighterHurtType*/public hitType:number;
        /**是否连击*/isDouble:boolean;
        constructor()
        {
            super();
            this.atkDataType = AtkDataType.ROUND;
            let s= this;
            s.hurt = 0;            
            s.heal = 0;
            s.suck = 0;      
            s.reduceMP = 0;
            s.reduceSP = 0;
            s.realHurt = 0;
            s.penetratePer = 0;
            s.ignoreShield = false;
        }
        public clear():void
        {
            let s= this;
            if(s.inPool)return;
            PoolUtil.toPool(s,s.constructor);            
            s.hurt = 0;            
            s.heal = 0;
            s.suck = 0;      
            s.reduceMP = 0;
            s.reduceSP = 0;
            s.realHurt = 0;  
        }
        public disposed: boolean;
        public poolId:number;
        public inPool:boolean;
        public outPoolInit():void
        {

        }
        public dispose():void
        {

        }
        
        /**创建受击的目标数据
         * @param skillID 技能id
         * @param hitType 击中类型         
        */
        public static create(skillCfg:SkillCfg, hitType:number):TargetData
        {            
            let target:TargetData;
            target = <TargetData>PoolUtil.fromPool(TargetData);
            target.skillID = skillCfg.skillId;            
            target.skillCfg = skillCfg;
            target.hitType = hitType;
            return target;
        }
    }
}